﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XPython;

public class UIPy : MonoBehaviour
{
    public static UIPy inst;

    PyEnv.PyObject pyobj;
    PyEnv.PyObject Py_Start;
    PyEnv.PyObject Py_OnDestroy;
    PyEnv.PyObject Py_Update;
    PyEnv.PyObject Py_OnGUI;

    void Awake()
    {
        inst = this;
        DontDestroyOnLoad(transform.gameObject);
    }

    // Use this for initialization
    void Start()
    {
        pyobj = ClientAppPy.pyenv.CreateClassInstance("ui", "UI");
        Py_Start = ClientAppPy.pyenv.GetMethod(pyobj, "Start");
        Py_OnDestroy = ClientAppPy.pyenv.GetMethod(pyobj, "OnDestroy");
        Py_Update = ClientAppPy.pyenv.GetMethod(pyobj, "Update");
        Py_OnGUI = ClientAppPy.pyenv.GetMethod(pyobj, "OnGUI");

        ClientAppPy.pyenv.CallFunction(Py_Start);
    }

    // Update is called once per frame
    void Update()
    {

    }
}
